{% extends "base.html" %}
{% from "bootstrap/pagination.html" import render_pagination %}
{% from "_marcos.html" import render_table %}


{% block title %}目录管理{% endblock %}

{% block page_content %}

<div class="page-header">

<a href="{{ url_for('content.add_catalog') }}" class="btn btn-primary">新增目录</a>
<p/>
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
     <thead>
        <tr>
        <th>ID</th>
        <th>名称</th>
        <th>说明</th>
        <th>链接</th>
         <th>操作</th>
        </tr>
    </thead>
    <tbody>
        {% for catalog in catalogs %}
            {% if loop.index%2==0 %}
                <tr class="odd">
            {% else %}
                <tr class="even">
            {% endif %}

            <td>{{ catalog.id }}</td>
            <td>{{ catalog.name }}</td>
            <td>{{ catalog.description }}</td>
            <td>{{ catalog.url }}</td>
            <td><a href="#" onclick="confirmAction('确定要删除此目录吗？','{{ url_for('content.delete_catalog',catalog_id=catalog.id) }}')"
               class="btn btn-danger">删除</a>
                <a href="{{ url_for('content.edit_catalog',catalog_id=catalog.id) }}" class="btn btn-primary">修改</a> </td>
        {% endfor %}
</tr>
    </tbody>
    </table>
</div>
{% endblock %}
